#ifndef __mine_remotor_h__
#define __mine_remotor_h__
#include "stm32f4xx.h"
#include <atkp.h>
#include "FreeRTOS.h"
#include "task.h"
#include <queue.h>
#include "stdlib.h"
#include "string.h"

enum expModuleID
{
    NO_MODULE,
    LED_RING,
    WIFI_CAMERA,
    OPTICAL_FLOW,
    MODULE1,
};

typedef struct
{
    u8 version;
    bool mpu_selfTest;
    bool baro_slfTest;
    bool isCanFly;
    bool isLowpower;
    enum expModuleID moduleID;

    float trimRoll;  /*roll微调*/
    float trimPitch; /*pitch微调*/
} MiniFlyMsg_t;


/*上行报告*/
#define  ACK_MSG			0x01

/*下行指令*/
#define D_RADIO_HEARTBEAT 0xFF
#define D_RADIO_GET_CONFIG 0x01
#define D_RADIO_SET_CONFIG 0x02
/*遥控数据类别*/
typedef enum
{
    REMOTER_CMD,
    REMOTER_DATA,
} remoterType_e;



/*下行命令*/
#define CMD_GET_MSG 0x01        /*获取四轴信息（自检）*/
#define CMD_GET_CANFLY 0x02     /*获取四轴是否能飞*/
#define CMD_FLIGHT_LAND 0x03    /*起飞、降落*/
#define CMD_EMER_STOP 0x04      /*紧急停机*/
#define CMD_FLIP 0x05           /*4D翻滚*/
#define CMD_POWER_MODULE 0x06   /*打开关闭扩展模块电源*/
#define CMD_LEDRING_EFFECT 0x07 /*设置RGB灯环效果*/
#define CMD_POWER_VL53LXX 0x08  /*打开关闭激光*/

void mine_remoter_ctrl_init(void);
void mine_remote_add_queue(atkp_t *pk);
uint8_t mine_remote_get_queue(atkp_t *pk);
void mine_remoterCtrlProcess(atkp_t *pk);
void mine_sendMsgACK(void);
void mine_printfPacket(atkp_t *ppacket);

extern TaskHandle_t mine_remoter_ctrl_task_handler;

void mine_remoter_ctrl_task(void *pvParameters);

#endif
